<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 
         返回一个promise实例  状态默认是成功,promiseResulte是返回return的值
        如果return  promise构造函数,返回的对象与promise构造函数的状态一致  
     -->
    <script>
        let pro = new Promise((resolve,reject)=>{
            resolve('成功')
        }).then(
            resolve=>{
                return new Promise((resolve,reject)=>{
                    setTimeout(function(){
                        resolve('通过')
                    },3000)
                }).then(
                    resolve=>{
                        return new Promise((resolve,reject)=>{
                            reject('拒绝')
                        })
                    },
                    reject=>{

                    }
                )
            },
            reject=>{

            }
        ).then(
            resolve=>{
                console.log(resolv+'resolv');
            },
            reject=>{
                console.log(reject+'reject');
            }
        ).then(
            a=>{
                console.log(a+'哈哈');
            },
            b=>{
                console.log(b+'嘻嘻');
            }
        )
    </script>
</body>
</html>